In a multi-threaded environment, garbage collector frequently attempts to reclaim memory occupied by objects that are no longer in use. Once an unreachable set of memory has been determined, the garbage collector may release the unreachable objects from the memory. Alternatively, it may copy some or all of the reachable objects from an aged memory into a new area of memory and update all references to those objects as needed.
To ensure that the memory block is freed safely so that an object is not reused while any thread still holds a pointer to it, some systems use a reference count to indicate how many threads or processes currently hold a reference to the object. However, such conventional reference-count manipulation mechanism may incur significant overhead and performance bottleneck. Furthermore, they do not scale well when there are highly-parallel workloads running on large multiprocessor systems. The problem is exacerbated in the environment where multiple threads concurrently read and write very large data collections from/to the memory blocks. As a result, conventional systems fail to provide an ideal reference-count mechanism for efficient memory utilization with low performance overhead and scalability.